<?php 
		include_once "library/democrart/modules/product_model/vo/OrderModelQuadroOptions.class.php";
		if(FALSE){$HttpResult = new HttpResult();}
		
		$HttpContentResult = $HttpResult->getHttpContentResult();
	  
//		Debug::print_r($HttpContentResult);
		$head = new HtmlHeader(new HttpHeader());
		$head->addCSS('reset');
		$head->addCSS('print','', 'print');
		$head->addCSS('ie',  'css/ie', 'print',true);
		
		$head->addCSS('forum',"css/admin");		
		
		//<!-- PROGRAMACAO JS | JQUERY  -->
		$head->addJS(array('jquery', 'masked'));
		
    //MENU DROPDOWN
    $head->addJS('Menu principal','js/menu/ddsmoothmenu');
    $head->addCSS('Menu CSS','js/menu/ddsmoothmenu');
    
    //TINYMCE
    $head->addJS('tinymce','js/tinymce/jquery.tinymce');
    
    //FILEUPLOAD
    $head->addJS('so','js/uploadify/swfobject');
    $head->addJS('uploadify','js/uploadify/jquery.uploadify.v2.1.4.min');
    $head->addCSS('Upload CSS','js/uploadify/uploadify');
		       
		//SLIDER SHOW
		$head->addJS('cycle', 'js/cycle/jquery.cycle.min');
	
		//<!-- JQUERY UI  -->
		$head->addJS('UI', 'js/UI/js/jquery-ui-1.8.6.custom.min');
		$head->addCSS('UI','js/UI/css/smoothness/jquery-ui-1.8.6.custom');
		
     //SELECTMENU
    $head->addJS('selectmenu','js/UI/development-bundle/ui/jquery.ui.selectmenu');
    $head->addCSS('selectmenu CSS','js/UI/css/jquery.ui.selectmenu');
    
    $head->addCSS('adminmenu','css/lista_produtos_admin');
    $head->addCSS('adminprodutos','css/produtos');
    
		//<!-- VTIP  -->
		$head->addJS('vtip', 'js/vtip/vtip');
		$head->addCSS('vtip', 'js/vtip/vtip');
		
		//<!-- TABLE SORTER -->
		$head->addJS('tablesorter', 'js/tablesorter/tablesorter');
		$head->addCSS('tablesorter', 'js/tablesorter/tablesorter');

    //<!-- PROGRAMACAO JS | JQUERY  -->
    $head->addJS(array('admin','admin_select'));
    $head->addJS('product', 'js/admin/product/product');
		
$header_html = $head->show(TRUE);
$header_html = str_replace(array("democrart", "democrArt", "Democrart", "DemocrArt"), array("expressaoartistica", "Expressão Artística", "Expressão Artística", "Expressão Artística"), $header_html);
echo $header_html;

function showOptionsAndSelectTheSelectableItem($array_itens, $id_selected = NULL){
	
	$text = "";
	foreach($array_itens as $itemStd){
		$selected = "";
		if($itemStd->id == $id_selected){
			//item selecionado
			$selected = " selected=\"selected\" ";
		}
		$text .= "
		<option value=\"$itemStd->id\" $selected >$itemStd->name</option>
		";
	}
	return $text;
}
?>
 
<body>

<div id="main">
      <?php include "view/democrart/parts/admin/header.php" ?>
	
	<div id="main_content">
	  
		<div id="msgBox">
			<?php 

					//se for setado o return_result_vo ele pega a array de messages e exibe, independende se Ã© erro ou sucesso
					if(isset($HttpContentResult->return_result_vo) && count($HttpContentResult->return_result_vo->array_messages) > 0){
				    	foreach($HttpContentResult->return_result_vo->array_messages as $system_message){
			//	    		$system_message = $formData->translateMessage($system_message);
							?>
							<p class="success"><?php echo $system_message; ?></p>
							<?php
				    	}
				    }
			?>	  
		</div>
	  			
		<div id="box_right">
			<h1>Inserir Tamanho</h1>
			
			<div style="clear:both">
				<form name="frmAddProduct" id="frmAddProduct" class="frm" method="post" action="<?php echo Config::getRootPath("admin/product/quadro/tamanho/novo/product_model.".$HttpContentResult->product_model."/product_model_id.".$HttpContentResult->product_model_id) ?>">
						<ul>
							<li>
								<label for="product_code">
								<input type="checkbox" name="active" id="active" class="req" value="1" <?php 
								if(DataHandler::getValueByArrayIndex($_POST, "active")){
									echo " checked=checked ";
								} 
								?>/>
								&nbsp;publicar?</label>
							</li>
							<li>
								<label for="product_code">*Código SKU (para auto criar, deixe vazio)</label>
								<input type="text" size="25" name="sku" id="sku" class="req" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "sku"); ?>"/>
							</li>
							<li>
								<label for="product_code">*Altura</label>
								<input type="text" size="25" name="height" id="height" class="req" value="<?php echo str_replace(".", ",", DataHandler::getValueByArrayIndex($_POST, "height")); ?>"/>
							</li>
							<li>
								<label for="product_code">*Largura</label>
								<input type="text" size="25" name="width" id="width" class="req" value="<?php echo str_replace(".", ",", DataHandler::getValueByArrayIndex($_POST, "width")); ?>"/>
							</li>
							<li>
								<label for="product_code">*Preço</label>
								<input type="text" size="25" name="price" id="price" class="req" value="<?php echo str_replace(".", ",", DataHandler::getValueByArrayIndex($_POST, "price")); ?>"/>
							</li>
							<li>
								<label for="product_code">*Stock</label>
								<input type="text" size="25" name="stock" id="stock" class="req" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "stock"); ?>"/>
							</li>
							<li>
								<label for="product_code">*Tiragem</label>
								<input type="text" size="25" name="drawing" id="drawing" class="req" value="<?php echo DataHandler::getValueByArrayIndex($_POST, "drawing"); ?>"/>
							</li>
							<li>
								<label for="product_code">*Material:</label>
									<select id="material_id" name="material_id">
										<?php echo showOptionsAndSelectTheSelectableItem($HttpContentResult->array_material, $HttpContentResult->material_id); ?>
									</select>
							</li>
							<li>
								<input type="submit" value="Enviar" id="enviar" class="btEnviar" />
							</li>
						</ul>
				</form>
			</div>
			
		</div>
		
	</div>
	
</div>
	


</body>
</html>